package org.eae.eldf.service.sys.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import org.eae.eldf.dao.sys.ISysPurviewDao;
import org.eae.eldf.dao.sys.impl.SysPurviewDaoImpl;
import org.eae.eldf.dto.sys.SysPurviewQueryDto;
import org.eae.eldf.entity.sys.SysPurview;
import org.eae.eldf.framework.pager.Pagination;
import org.eae.eldf.framework.persistence.Criteria;
import org.eae.eldf.framework.service.BaseServiceImpl;
import org.eae.eldf.service.sys.SysPurviewService;

@Service
@Transactional
public class SysPurviewServiceImpl extends BaseServiceImpl<SysPurview> implements SysPurviewService{

	private ISysPurviewDao purviewDao;

	@Autowired
	public void setPurviewDao(SysPurviewDaoImpl purviewDao) {
		this.purviewDao = purviewDao;
		this.dao = purviewDao;
	}

	@Override
	public SysPurview getById(Long id) {
		return  purviewDao.get(SysPurview.class, id);
	}

	@Override
	public Pagination<SysPurview> purList(Pagination<SysPurview> page,Long parentId) {
		return purviewDao.purList(page, parentId);
	}

	@Override
	public void delete(Long id) {
		purviewDao.delete(Criteria.create(SysPurview.class).where("sysPurviewId", new Object[]{id}));
	}

	@Override
	public Pagination<SysPurview> queryPagePurviewList(Pagination<SysPurview> pager,
			SysPurviewQueryDto sysPurviewQueryDto) {
		// TODO Auto-generated method stub
		return purviewDao.queryPagePurviewList(pager,sysPurviewQueryDto);
	}
}
